#include "password.h"
#include "ui_password.h"

PasswordDialog::PasswordDialog(QWidget *parent):
				 QDialog(parent),
				 ui(new Ui::PasswordDialog) 
{
	ui->setupUi(this);
	setLayout(ui->BaseLayout->layout());
	connect(ui->buttonOk, SIGNAL(clicked()), this, SLOT(gotPassword()));
}

void PasswordDialog::setText(const QString& text) {
	ui->label->setText(text);
}

void PasswordDialog::gotPassword() {
	QString pass = ui->editPassword->text();
	returnPassword(pass);
	ui->editPassword->setText("");
	this->accept();
}

PasswordDialog::~PasswordDialog() {
}